#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

char* my_strcat(char* p, char* y)
{
	char* pp = p;
	char* yy = y;
	while (1)
	{
		if (*p != '\0' && yy == y)
		{
			p++;
		}
		else
		{
			if (*y != '\0')
			{
				*(p++) = *(y++);
			}
			else
			{
				*p = *y;
				return pp;
			}
		}
	}
	return pp;
}

int main()
{
	char arr[30] = "";
	strcat(arr, "hello world ");
	printf("1. arr = %s", arr);
	strcat(arr, "and china");
	printf("2. arr = %s", arr);

	return 0;
}